pixelcache: Split out a function
authorBenjamin Otte <otte@redhat.com>
Wed, 9 Apr 2014 21:28:50 +0000 (23:28 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 9 Apr 2014 22:16:53 +0000 (00:16 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=726475

gtk/gtkpixelcache.c

index 4cc07171d7639769bd1fe766a55009347886d07f..2a909641f7bce67a91ff3be32de25b9b76370275 100644 (file)
@@ -377,12 +377,14 @@ _gtk_pixel_cache_repaint (GtkPixelCache *cache,
     cairo_region_destroy (region_dirty);
 }
 
-static gboolean
-blow_cache_cb  (gpointer user_data)
+static void
+gtk_pixel_cache_blow_cache (GtkPixelCache *cache)
 {
-  GtkPixelCache *cache = user_data;
-
-  cache->timeout_tag = 0;
+  if (cache->timeout_tag)
+    {
+      g_source_remove (cache->timeout_tag);
+      cache->timeout_tag = 0;
+    }
 
   if (cache->surface)
     {
@@ -392,6 +394,16 @@ blow_cache_cb  (gpointer user_data)
        cairo_region_destroy (cache->surface_dirty);
       cache->surface_dirty = NULL;
     }
+}
+
+static gboolean
+blow_cache_cb  (gpointer user_data)
+{
+  GtkPixelCache *cache = user_data;
+
+  cache->timeout_tag = 0;
+
+  gtk_pixel_cache_blow_cache (cache);
 
   return G_SOURCE_REMOVE;
 }